﻿using System;

class Program
{
    static void Main()
    {
        Console.Write("输入两个整数，分别为下限和上限，用回车分隔:\n ");

        int down = int.Parse(Console.ReadLine());
        int up = int.Parse(Console.ReadLine());

        Console.WriteLine($"\n范围 {down} 到 {up} 之间的素数:");

        int count = 0;

        for (int i = down; i <= up; i++)
        {
            if (Judge(i))
            {
                Console.Write(i + " ");
            }
        }
    }

     static bool Judge(int num)
    {
        if (num < 2) return false;
        for (int i = 2; i * i <= num; i++)
        {
            if (num % i == 0) return false;
        }
        return true;
    }
}
